<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layDate快速使用</title>
    <link rel="stylesheet" href="../../static/layui/css/layui.css">
</head>
<body>

<div class="layui-inline"> <!-- 注意：这一层元素并不是必须的 -->
    <input type="text" class="layui-input" id="test1">
</div>

<script src="../../static/layui/layui.js"></script>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#test1' //指定元素
            , ready: function (date) {
                console.log(date);
                console.log("ready");
                var y = date.year;
                var m = date.month;
                var d = date.date;
                var nowDate = y + "-" + m + "-" + d;
                console.log(nowDate);

            }
            , done: function (value, date, endDate) {
                console.log("done"+value);
                console.log(date);
            }
        });
        var date = new Date();
        console.log(date);
        /*var date = new Date();
        var localmesc = date.getTime();
        var localOffset = date.getTimezoneOffset()*60000;
        var utc = localOffset+localmesc;
        var calctime = utc + (3600000*8);
        var nd = new Date(calctime);
        console.log(nd);*/
    });
</script>
</body>
</html>